package com.kmproject.haifu.mvp.model.api.service;

import com.kmproject.haifu.mvp.model.api.Api;
import com.kmproject.haifu.mvp.model.entity.ResultBean;
import com.kmproject.haifu.mvp.model.entity.beans.ConvenientPaymentRecordBean;
import com.kmproject.haifu.mvp.model.entity.beans.ExchangeRateBean;
import com.kmproject.haifu.mvp.model.entity.beans.HousePayWayBean;
import com.kmproject.haifu.mvp.model.entity.beans.MemberBuyRecordInfoBean;
import com.kmproject.haifu.mvp.model.entity.beans.MemberCenterUserInfoBean;
import com.kmproject.haifu.mvp.model.entity.beans.MemberFeatureBean;
import com.kmproject.haifu.mvp.model.entity.beans.MemberPayResultBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface MemberCenterService {

    //获取会员用户信息
    @GET("/app/memberLevel/getMemberLevelByUser")
    Observable<ResultBean<MemberCenterUserInfoBean>> getMemberLevelByUser();

    //获取不同等级特权信息
    @GET("/app/memberFunctionConfigure/getMemberFunctionConfigure")
    Observable<ResultBean<List<MemberFeatureBean>>> getMemberFunctionConfigure(@Query("memberLevelId") String memberLevelId);

    //获取缴费记录
    @GET("/app/memberUpgradeRecord/getMemberUpgradeRecordList")
    Observable<ResultBean<List<MemberBuyRecordInfoBean>>> getMemberUpgradeRecordList();

    //获取会员等级列表
    @GET("/app/memberLevel/getMemberLevelList")
    Observable<ResultBean<List<MemberCenterUserInfoBean.MemberLevelBean>>> getMemberLevelList();

    //获取规则列表根据等级id
    @GET("/app/memberUpgradeRule/getMemberUpgradeRuleList")
    Observable<ResultBean<List<MemberCenterUserInfoBean.MemberLevelBean>>> getMemberUpgradeRuleList(@Query("memberLevelId") String memberLevelId, @Query("isAutoRenew") String isAutoRenew);


    //获取续费自动管理相关数据
    @GET("/app/memberUpgradeRecord/ManageAutomaticRenewal")
    Observable<ResultBean<MemberCenterUserInfoBean.MemberLevelBean>> ManageAutomaticRenewal();


    //微信支付
    @POST("/app/pay/memberPay")
    Observable<ResultBean<MemberPayResultBean>> memberPay(@Body RequestBody body);


    //获取实时汇率，汇率转换
    @GET("/app/pay/getExchangeRate")
    Observable<ResultBean<ExchangeRateBean>> getExchangeRate(@Query("configureId") String configureId, @Query("upgradeRuleId") String upgradeRuleId);

    //获取实时汇率，汇率转换
    @GET("/app/pay/getExchangeRate")
    Observable<ResultBean<ExchangeRateBean>> getExchangeRate_2(@Query("amount") String amount);

    //获取充值缴费预支付订单信息（支付宝）
    @POST("/app/pay/investMoney")
    Observable<ResultBean<String>> payInvestMoney4AliPay(@Body RequestBody body);

    //获取充值缴费预支付订单信息(微信)
    @POST("/app/pay/investMoney")
    Observable<ResultBean<MemberPayResultBean>> payInvestMoney4Wx(@Body RequestBody body);

    //获取租房付款方式
    @FormUrlEncoded
    @POST("/app/dictList")
    Observable<ResultBean<List<HousePayWayBean>>> dictList(@Field("value") String value, @Field("category") String category);

    //升级主页获取不同等级特权信息
    @GET("/app/memberFunctionConfigure/getMemberPrivilege")
    Observable<ResultBean<List<MemberFeatureBean>>> getMemberPrivilege(@Query("memberLevelId") String memberLevelId);

    //关闭自动缴费
    @POST("/app/memberUpgradeRecord/closeAutomaticRenewal")
    Observable<ResultBean> closeAutomaticRenewal();

    //获取区域
    @GET("/app/baseArea/getAreaTree")
    Observable<ResultBean<List<HousePayWayBean>>> getAreaTree(@Query("value") String value, @Query("category") String category);


    //支付宝支付
    @POST("/app/pay/memberPay")
    Observable<ResultBean<String>> memberPayForAli(@Body RequestBody body);

    //查询当前用户的充值缴费记录
    @POST(Api.INVEST_MONEY_RECORD_LIST_CURRENT_USER)
    Observable<ResultBean<List<ConvenientPaymentRecordBean>>> convenientPaymentRecord(@Body RequestBody body);

}
